$.delDevice = function delDevice(sn) {
    let sns = [];
    if (sn == undefined) {
        let $checkbox = $("tbody").find("input[type='checkbox']");
        $checkbox.each(function(index, item) {
            if ($(this).is(':checked')) {
                sns.push($(this).val());
            }
        });
    } else {
        sns.push(sn);
    }
    if (sns.length == 0) {
        alert("请至少选择一台设备");
        return;
    }
    $.confirm({
        title: '删除设备',
        message: "确定是否删除设备？",
        confirm: function() {
            $.myAjax({
                url: "device/delDevice.do",
                dataType: "json",
                contentType: "application/json",
                data: JSON.stringify({
                    sns: sns
                }),
                success: function(res) {
                    var table = $(".table").DataTable();
                    table.draw();
                }
            });
        }
    });
}
